package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName device_usage_record
 */
@TableName(value ="device_usage_record")
@Data
public class DeviceUsageRecord {
    /**
     * 
     */
    @TableId(value = "usage_id", type = IdType.AUTO)
    private Integer usageId;

    /**
     * 
     */
    @TableField(value = "device_id")
    private Integer deviceId;

    /**
     * 
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 
     */
    @TableField(value = "start_time")
    private Date startTime;

    /**
     * 
     */
    @TableField(value = "end_time")
    private Date endTime;

    /**
     * 
     */
    @TableField(value = "usage_purpose")
    private String usagePurpose;

    /**
     * 
     */
    @TableField(value = "usage_result")
    private String usageResult;

    /**
     * 
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceUsageRecord other = (DeviceUsageRecord) that;
        return (this.getUsageId() == null ? other.getUsageId() == null : this.getUsageId().equals(other.getUsageId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getUsagePurpose() == null ? other.getUsagePurpose() == null : this.getUsagePurpose().equals(other.getUsagePurpose()))
            && (this.getUsageResult() == null ? other.getUsageResult() == null : this.getUsageResult().equals(other.getUsageResult()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUsageId() == null) ? 0 : getUsageId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getUsagePurpose() == null) ? 0 : getUsagePurpose().hashCode());
        result = prime * result + ((getUsageResult() == null) ? 0 : getUsageResult().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", usageId=").append(usageId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", userId=").append(userId);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", usagePurpose=").append(usagePurpose);
        sb.append(", usageResult=").append(usageResult);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}